h1 Pure Grids Demo

- var gridCnt = [1, 2, 3, 4, 5, 6, 8, 12, 24]
- for (var key in gridCnt) {
div.pure-g-r
    - var i = gridCnt[key]
    - for (var j=1; j<=i; j++) {
        - var classname = 'pure-u-1'
        - if (1 != i) {
        -   classname = 'pure-u-1-' + i
        - }
        div(class=classname)
            div.wrap-col.
                !{classname}
    - }
- }

h1 24ths-Based Units

- for (var i=1; i<=24; i++) {
div.pure-g-r
    - var gcd_t = gcd (i, 24)
    - var classname = ''
    if gcd_t == 24
        - classname = 'pure-u-1'
    else
        - classname = 'pure-u-' + i / gcd_t + '-' + 24 / gcd_t
    div(class=classname)
        div.wrap-col.
            !{classname}
- }

- function gcd (a, b) {
-   if(a == 0) return b;
-   if(b == 0) return a;
-   if(a % 2 == 0 && b % 2 == 0) return 2 * gcd(a >> 1, b >> 1);
-   else if(a % 2 == 0) return gcd(a >> 1, b);
-   else if(b % 2 == 0) return gcd(a, b >> 1);
-   else return gcd(Math.abs(a - b), Math.min(a, b));
- }
